﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using VOL.Entity.AttributeManager;
using VOL.SmartMecial.Dtos;
using VOL.SmartMecial.IServices.BasicData;

namespace VOL.WebApi.Controllers.SmartMecial
{
    [Route("api/TreeController")]
    [PermissionTable(Name = "TreeController")]
    public class TreeController : ControllerBase
    {
        private readonly ITreeService _service;

        public TreeController(ITreeService service)
        {
            _service = service;
        }

        /// <summary>
        /// 树形控制器
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetTree")]
        public async Task<List<TreeDTO>> GetTree()
        {
            return await _service.GetTree();
        }
    }
}
